#pragma strict

var isMatch : boolean = false;
var otherBall : GameObject;

function OnTriggerStay(other : Collider) {
	
	//if (other.rigidbody.velocity.magnitude == 0){
		if (other.transform.name == transform.parent.name) {
			//Debug.Log(transform.parent.name + "match");
			isMatch = true;
			otherBall = other.gameObject;
		}
		else {
			isMatch = false;
			otherBall = null;
		}
	//}
}

function OnTriggerExit(other : Collider) {

	isMatch = false;
	otherBall = null;
}